import request from '@/utilities/request';

// 获取菜单列表
export const getMenuListService = (reqData) =>
  request.post('/api/AppPermission/GetAppMenuList', reqData);

// 获取菜单列表（供下拉选择时使用）
export const getMenuListForSelectService = () =>
  request.post('/api/AppPermission/GetAppMenuListForSelect');

// 获取菜单详情
export const getMenuDetailService = (reqData) =>
  request.post('/api/AppPermission/GetAppMenuDetail', reqData);

// 编辑菜单
export const menuEditService = (reqData) =>
  request.post('/api/AppPermission/EditAppMenu', reqData);

// 删除菜单
export const menuDeleteService = (reqData) =>
  request.post('/api/AppPermission/DeleteAppMenu', reqData);

/* ------------------------------------------------------------------------ */

// 获取角色列表
export const getRoleListService = (reqData) =>
  request.post('/api/AppPermission/GetAppRoleList', reqData);

// 获取角色详情
export const getRoleDetailService = (reqData) =>
  request.post('/api/AppPermission/GetAppRoleDetail', reqData);

// 编辑角色
export const editRoleService = (reqData) =>
  request.post('/api/AppPermission/EditAppRole', reqData);

// 删除角色
export const deleteRoleService = (reqData) =>
  request.post('/api/AppPermission/DeleteAppRole', reqData);

// 获取角色的菜单
export const getRoleMenusService = (reqData) =>
  request.post('/api/AppPermission/GetRoleMenus', reqData);

// 设置角色的菜单
export const setRoleMenusService = (reqData) =>
  request.post('/api/AppPermission/SetRoleMenus', reqData);

/* ------------------------------------------------------------------------ */

// 获取给定角色的用户
export const getRoleUserListService = (reqData) =>
  request.post('/api/AppPermission/GetRoleUserList', reqData);

// 获取用户的角色
export const getUserRolesService = (reqData) =>
  request.post('/api/AppPermission/GetUserRoles', reqData);

// 设置用户的角色
export const setUserRolesService = (reqData) =>
  request.post('/api/AppPermission/SetUserRoles', reqData);
